<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkUIManager</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GTK+ 3 参考手册">
<link rel="up" href="Actions.html" title="基于行为的菜单和工具栏">
<link rel="prev" href="Actions.html" title="基于行为的菜单和工具栏">
<link rel="next" href="gtk3-GtkActionGroup.html" title="GtkActionGroup">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="Actions.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="Actions.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ 3 参考手册</th>
<td><a accesskey="n" href="gtk3-GtkActionGroup.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gtk3-GtkUIManager.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gtk3-GtkUIManager.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="gtk3-GtkUIManager"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gtk3-GtkUIManager.top_of_page"></a>GtkUIManager</span></h2>
<p>GtkUIManager</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gtk3-GtkUIManager.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gtk/gtk.h&gt;

struct              <a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager">GtkUIManager</a>;
<a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="returnvalue">GtkUIManager</span></a> *      <a class="link" href="gtk3-GtkUIManager.html#gtk-ui-manager-new" title="gtk_ui_manager_new ()">gtk_ui_manager_new</a>                  (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkUIManager.html#gtk-ui-manager-set-add-tearoffs" title="gtk_ui_manager_set_add_tearoffs ()">gtk_ui_manager_set_add_tearoffs</a>     (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> add_tearoffs</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk3-GtkUIManager.html#gtk-ui-manager-get-add-tearoffs" title="gtk_ui_manager_get_add_tearoffs ()">gtk_ui_manager_get_add_tearoffs</a>     (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkUIManager.html#gtk-ui-manager-insert-action-group" title="gtk_ui_manager_insert_action_group ()">gtk_ui_manager_insert_action_group</a>  (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkActionGroup.html#GtkActionGroup" title="struct GtkActionGroup"><span class="type">GtkActionGroup</span></a> *action_group</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> pos</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkUIManager.html#gtk-ui-manager-remove-action-group" title="gtk_ui_manager_remove_action_group ()">gtk_ui_manager_remove_action_group</a>  (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkActionGroup.html#GtkActionGroup" title="struct GtkActionGroup"><span class="type">GtkActionGroup</span></a> *action_group</code></em>);
<a href="../glib/glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a> *             <a class="link" href="gtk3-GtkUIManager.html#gtk-ui-manager-get-action-groups" title="gtk_ui_manager_get_action_groups ()">gtk_ui_manager_get_action_groups</a>    (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>);
<a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup" title="struct GtkAccelGroup"><span class="returnvalue">GtkAccelGroup</span></a> *     <a class="link" href="gtk3-GtkUIManager.html#gtk-ui-manager-get-accel-group" title="gtk_ui_manager_get_accel_group ()">gtk_ui_manager_get_accel_group</a>      (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>);
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkUIManager.html#gtk-ui-manager-get-widget" title="gtk_ui_manager_get_widget ()">gtk_ui_manager_get_widget</a>           (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *path</code></em>);
<a href="../glib/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> *            <a class="link" href="gtk3-GtkUIManager.html#gtk-ui-manager-get-toplevels" title="gtk_ui_manager_get_toplevels ()">gtk_ui_manager_get_toplevels</a>        (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManagerItemType" title="enum GtkUIManagerItemType"><span class="type">GtkUIManagerItemType</span></a> types</code></em>);
<a class="link" href="gtk3-GtkAction.html#GtkAction" title="struct GtkAction"><span class="returnvalue">GtkAction</span></a> *         <a class="link" href="gtk3-GtkUIManager.html#gtk-ui-manager-get-action" title="gtk_ui_manager_get_action ()">gtk_ui_manager_get_action</a>           (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *path</code></em>);
<a href="../glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               <a class="link" href="gtk3-GtkUIManager.html#gtk-ui-manager-add-ui-from-string" title="gtk_ui_manager_add_ui_from_string ()">gtk_ui_manager_add_ui_from_string</a>   (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gssize"><span class="type">gssize</span></a> length</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="../glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               <a class="link" href="gtk3-GtkUIManager.html#gtk-ui-manager-add-ui-from-file" title="gtk_ui_manager_add_ui_from_file ()">gtk_ui_manager_add_ui_from_file</a>     (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="../glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               <a class="link" href="gtk3-GtkUIManager.html#gtk-ui-manager-new-merge-id" title="gtk_ui_manager_new_merge_id ()">gtk_ui_manager_new_merge_id</a>         (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>);
enum                <a class="link" href="gtk3-GtkUIManager.html#GtkUIManagerItemType" title="enum GtkUIManagerItemType">GtkUIManagerItemType</a>;
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkUIManager.html#gtk-ui-manager-add-ui" title="gtk_ui_manager_add_ui ()">gtk_ui_manager_add_ui</a>               (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> merge_id</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *path</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *action</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManagerItemType" title="enum GtkUIManagerItemType"><span class="type">GtkUIManagerItemType</span></a> type</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> top</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkUIManager.html#gtk-ui-manager-remove-ui" title="gtk_ui_manager_remove_ui ()">gtk_ui_manager_remove_ui</a>            (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> merge_id</code></em>);
<a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *             <a class="link" href="gtk3-GtkUIManager.html#gtk-ui-manager-get-ui" title="gtk_ui_manager_get_ui ()">gtk_ui_manager_get_ui</a>               (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkUIManager.html#gtk-ui-manager-ensure-update" title="gtk_ui_manager_ensure_update ()">gtk_ui_manager_ensure_update</a>        (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="gtk3-GtkUIManager.description"></a><h2>Description</h2>
<p>
</p>
</div>
<div class="refsect1">
<a name="gtk3-GtkUIManager.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GtkUIManager"></a><h3>struct GtkUIManager</h3>
<pre class="programlisting">struct GtkUIManager {
  GObject parent;
};
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-ui-manager-new"></a><h3>gtk_ui_manager_new ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="returnvalue">GtkUIManager</span></a> *      gtk_ui_manager_new                  (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Creates a new ui manager object.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new ui manager object.</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-ui-manager-set-add-tearoffs"></a><h3>gtk_ui_manager_set_add_tearoffs ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_ui_manager_set_add_tearoffs     (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> add_tearoffs</code></em>);</pre>
<p>
Sets the "add_tearoffs" property, which controls whether menus 
generated by this <a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> will have tearoff menu items. 
</p>
<p>
Note that this only affects regular menus. Generated popup 
menus never have tearoff menu items.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>add_tearoffs</code></em> :</span></p></td>
<td>whether tearoff menu items are added</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-ui-manager-get-add-tearoffs"></a><h3>gtk_ui_manager_get_add_tearoffs ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_ui_manager_get_add_tearoffs     (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>);</pre>
<p>
Returns whether menus generated by this <a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a>
will have tearoff menu items.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>whether tearoff menu items are added</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-ui-manager-insert-action-group"></a><h3>gtk_ui_manager_insert_action_group ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_ui_manager_insert_action_group  (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkActionGroup.html#GtkActionGroup" title="struct GtkActionGroup"><span class="type">GtkActionGroup</span></a> *action_group</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> pos</code></em>);</pre>
<p>
Inserts an action group into the list of action groups associated 
with <em class="parameter"><code>manager</code></em>. Actions in earlier groups hide actions with the same 
name in later groups.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>action_group</code></em> :</span></p></td>
<td>the action group to be inserted</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>pos</code></em> :</span></p></td>
<td>the position at which the group will be inserted.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-ui-manager-remove-action-group"></a><h3>gtk_ui_manager_remove_action_group ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_ui_manager_remove_action_group  (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkActionGroup.html#GtkActionGroup" title="struct GtkActionGroup"><span class="type">GtkActionGroup</span></a> *action_group</code></em>);</pre>
<p>
Removes an action group from the list of action groups associated 
with <em class="parameter"><code>manager</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>action_group</code></em> :</span></p></td>
<td>the action group to be removed</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-ui-manager-get-action-groups"></a><h3>gtk_ui_manager_get_action_groups ()</h3>
<pre class="programlisting"><a href="../glib/glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a> *             gtk_ui_manager_get_action_groups    (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>);</pre>
<p>
Returns the list of action groups associated with <em class="parameter"><code>manager</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> object</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a href="../glib/glib-Doubly-Linked-Lists.html#GList"><span class="type">GList</span></a> of
action groups. The list is owned by GTK+
and should not be modified. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GtkActionGroup][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-ui-manager-get-accel-group"></a><h3>gtk_ui_manager_get_accel_group ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup" title="struct GtkAccelGroup"><span class="returnvalue">GtkAccelGroup</span></a> *     gtk_ui_manager_get_accel_group      (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>);</pre>
<p>
Returns the <a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup" title="struct GtkAccelGroup"><span class="type">GtkAccelGroup</span></a> associated with <em class="parameter"><code>manager</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> object</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the <a class="link" href="gtk3-Keyboard-Accelerators.html#GtkAccelGroup" title="struct GtkAccelGroup"><span class="type">GtkAccelGroup</span></a>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-ui-manager-get-widget"></a><h3>gtk_ui_manager_get_widget ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_ui_manager_get_widget           (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *path</code></em>);</pre>
<p>
Looks up a widget by following a path. 
The path consists of the names specified in the XML description of the UI. 
separated by '/'. Elements which don't have a name or action attribute in 
the XML (e.g. &lt;popup&gt;) can be addressed by their XML element name 
(e.g. "popup"). The root element ("/ui") can be omitted in the path.
</p>
<p>
Note that the widget found by following a path that ends in a &lt;menu&gt;
element is the menuitem to which the menu is attached, not the menu itmanager.
</p>
<p>
Also note that the widgets constructed by a ui manager are not tied to 
the lifecycle of the ui manager. If you add the widgets returned by this 
function to some container or explicitly ref them, they will survive the
destruction of the ui manager.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
<td>a path</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the widget found by following the path, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if no widget
was found. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-ui-manager-get-toplevels"></a><h3>gtk_ui_manager_get_toplevels ()</h3>
<pre class="programlisting"><a href="../glib/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> *            gtk_ui_manager_get_toplevels        (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManagerItemType" title="enum GtkUIManagerItemType"><span class="type">GtkUIManagerItemType</span></a> types</code></em>);</pre>
<p>
Obtains a list of all toplevel widgets of the requested types.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>types</code></em> :</span></p></td>
<td>specifies the types of toplevel widgets to include. Allowed
types are <span class="type">GTK_UI_MANAGER_MENUBAR</span>, <span class="type">GTK_UI_MANAGER_TOOLBAR</span> and
<span class="type">GTK_UI_MANAGER_POPUP</span>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a newly-allocated <a href="../glib/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> of
all toplevel widgets of the requested types.  Free the returned list with <a href="../glib/glib-Singly-Linked-Lists.html#g-slist-free"><code class="function">g_slist_free()</code></a>. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GtkWidget][<acronym title="Free data container after the code is done."><span class="acronym">transfer container</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-ui-manager-get-action"></a><h3>gtk_ui_manager_get_action ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkAction.html#GtkAction" title="struct GtkAction"><span class="returnvalue">GtkAction</span></a> *         gtk_ui_manager_get_action           (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *path</code></em>);</pre>
<p>
Looks up an action by following a path. See <a class="link" href="gtk3-GtkUIManager.html#gtk-ui-manager-get-widget" title="gtk_ui_manager_get_widget ()"><code class="function">gtk_ui_manager_get_widget()</code></a>
for more information about paths.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
<td>a path</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the action whose proxy widget is found by following the path,
or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if no widget was found. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-ui-manager-add-ui-from-string"></a><h3>gtk_ui_manager_add_ui_from_string ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               gtk_ui_manager_add_ui_from_string   (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gssize"><span class="type">gssize</span></a> length</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Parses a string containing a UI definition and 
merges it with the current contents of <em class="parameter"><code>manager</code></em>. An enclosing &lt;ui&gt; 
element is added if it is missing.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>the string to parse</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>the length of <em class="parameter"><code>buffer</code></em> (may be -1 if <em class="parameter"><code>buffer</code></em> is nul-terminated)</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>return location for an error</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The merge id for the merged UI. The merge id can be used
to unmerge the UI with <a class="link" href="gtk3-GtkUIManager.html#gtk-ui-manager-remove-ui" title="gtk_ui_manager_remove_ui ()"><code class="function">gtk_ui_manager_remove_ui()</code></a>. If an error occurred,
the return value is 0.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-ui-manager-add-ui-from-file"></a><h3>gtk_ui_manager_add_ui_from_file ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               gtk_ui_manager_add_ui_from_file     (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Parses a file containing a UI definition and 
merges it with the current contents of <em class="parameter"><code>manager</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td>
<td>the name of the file to parse. <span class="annotation">[<acronym title="Override the parsed C type with given type"><span class="acronym">type</span></acronym> filename]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>return location for an error</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>The merge id for the merged UI. The merge id can be used
to unmerge the UI with <a class="link" href="gtk3-GtkUIManager.html#gtk-ui-manager-remove-ui" title="gtk_ui_manager_remove_ui ()"><code class="function">gtk_ui_manager_remove_ui()</code></a>. If an error occurred,
the return value is 0.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-ui-manager-new-merge-id"></a><h3>gtk_ui_manager_new_merge_id ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               gtk_ui_manager_new_merge_id         (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>);</pre>
<p>
Returns an unused merge id, suitable for use with 
<a class="link" href="gtk3-GtkUIManager.html#gtk-ui-manager-add-ui" title="gtk_ui_manager_add_ui ()"><code class="function">gtk_ui_manager_add_ui()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>an unused merge id.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkUIManagerItemType"></a><h3>enum GtkUIManagerItemType</h3>
<pre class="programlisting">typedef enum {
  GTK_UI_MANAGER_AUTO              = 0,
  GTK_UI_MANAGER_MENUBAR           = 1 &lt;&lt; 0,
  GTK_UI_MANAGER_MENU              = 1 &lt;&lt; 1,
  GTK_UI_MANAGER_TOOLBAR           = 1 &lt;&lt; 2,
  GTK_UI_MANAGER_PLACEHOLDER       = 1 &lt;&lt; 3,
  GTK_UI_MANAGER_POPUP             = 1 &lt;&lt; 4,
  GTK_UI_MANAGER_MENUITEM          = 1 &lt;&lt; 5,
  GTK_UI_MANAGER_TOOLITEM          = 1 &lt;&lt; 6,
  GTK_UI_MANAGER_SEPARATOR         = 1 &lt;&lt; 7,
  GTK_UI_MANAGER_ACCELERATOR       = 1 &lt;&lt; 8,
  GTK_UI_MANAGER_POPUP_WITH_ACCELS = 1 &lt;&lt; 9
} GtkUIManagerItemType;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-ui-manager-add-ui"></a><h3>gtk_ui_manager_add_ui ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_ui_manager_add_ui               (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> merge_id</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *path</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *action</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManagerItemType" title="enum GtkUIManagerItemType"><span class="type">GtkUIManagerItemType</span></a> type</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> top</code></em>);</pre>
<p>
Adds a UI element to the current contents of <em class="parameter"><code>manager</code></em>. 
</p>
<p>
If <em class="parameter"><code>type</code></em> is <code class="literal">GTK_UI_MANAGER_AUTO</code>, GTK+ inserts a menuitem, toolitem or 
separator if such an element can be inserted at the place determined by 
<em class="parameter"><code>path</code></em>. Otherwise <em class="parameter"><code>type</code></em> must indicate an element that can be inserted at 
the place determined by <em class="parameter"><code>path</code></em>.
</p>
<p>
If <em class="parameter"><code>path</code></em> points to a menuitem or toolitem, the new element will be inserted
before or after this item, depending on <em class="parameter"><code>top</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>merge_id</code></em> :</span></p></td>
<td>the merge id for the merged UI, see <a class="link" href="gtk3-GtkUIManager.html#gtk-ui-manager-new-merge-id" title="gtk_ui_manager_new_merge_id ()"><code class="function">gtk_ui_manager_new_merge_id()</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>path</code></em> :</span></p></td>
<td>a path</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td>the name for the added UI element</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>action</code></em> :</span></p></td>
<td>the name of the action to be proxied, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to add a separator. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
<td>the type of UI element to add.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>top</code></em> :</span></p></td>
<td>if <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, the UI element is added before its siblings, otherwise it
is added after its siblings.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-ui-manager-remove-ui"></a><h3>gtk_ui_manager_remove_ui ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_ui_manager_remove_ui            (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> merge_id</code></em>);</pre>
<p>
Unmerges the part of <em class="parameter"><code>manager</code></em>s content identified by <em class="parameter"><code>merge_id</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> object</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>merge_id</code></em> :</span></p></td>
<td>a merge id as returned by <a class="link" href="gtk3-GtkUIManager.html#gtk-ui-manager-add-ui-from-string" title="gtk_ui_manager_add_ui_from_string ()"><code class="function">gtk_ui_manager_add_ui_from_string()</code></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-ui-manager-get-ui"></a><h3>gtk_ui_manager_get_ui ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *             gtk_ui_manager_get_ui               (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>);</pre>
<p>
Creates a UI definition of the merged UI.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A newly allocated string containing an XML representation of
the merged UI.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-ui-manager-ensure-update"></a><h3>gtk_ui_manager_ensure_update ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_ui_manager_ensure_update        (<em class="parameter"><code><a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> *manager</code></em>);</pre>
<p>
Makes sure that all pending updates to the UI have been completed.
</p>
<p>
This may occasionally be necessary, since <a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a> updates the 
UI in an idle function. A typical example where this function is
useful is to enforce that the menubar and toolbar have been added to 
the main window before showing it:
</p>
<div class="informalexample"><pre class="programlisting">
gtk_container_add (GTK_CONTAINER (window), vbox); 
g_signal_connect (merge, "add-widget", 
                  G_CALLBACK (add_widget), vbox);
gtk_ui_manager_add_ui_from_file (merge, "my-menus");
gtk_ui_manager_add_ui_from_file (merge, "my-toolbars");
gtk_ui_manager_ensure_update (merge);  
gtk_widget_show (window);
</pre></div>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkUIManager.html#GtkUIManager" title="struct GtkUIManager"><span class="type">GtkUIManager</span></a>
</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>